import request from '@/utils/request.js'

//获取文章分类列表
export const articleCategoryListService=()=>{
    return request({
        method:'get',
        url:'/category'
    })
}

//添加文章分类
export const addArticleCategoryService=(articleCategory)=>{
    return request({
        method:'post',
        url:'/category',
        data:articleCategory
    })
}

//更新文章分类
export const updateArticleCategoryService=(articleCategory)=>{
    return request({
        method:'put',
        url:'/category',
        data:articleCategory
    })
}

//删除文章分类
export const deleteArticleCategoryService=(id)=>{
    return request({
        method:'delete',
        url:'/category?id='+id
    })
}

//获取文章列表
export const articleListService=(params)=>{
    return request({
        method:'get',
        url:'/article',
        params:params
    })
}

//新增文章
export const addArticleService=(article)=>{
    return request({
        method:'post',
        url:'/article',
        data:article
    })
}

//修改文章
export const updateArticleService=(article)=>{
    return request({
        method:'put',
        url:'/article',
        data:article
    })
}

//删除文章
export const deleteArticleService=(id)=>{
    return request({
        method:'delete',
        url:'/article?id='+id
    })
}